﻿using System;
using System.Diagnostics;
using System.Web;
using System.Web.Hosting;
using EPiCloner.ResourcesRegistration;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;

namespace EPiCloner.Initialization
{
    [InitializableModule]
    [ModuleDependency(new Type[] { typeof(EPiServer.Web.InitializationModule)})]
    public class VppInitializationModule : IInitializableModule
    {
        public void Initialize(InitializationEngine context)
        {
            if (HttpContext.Current == null)
                return;
            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/EPiCloner.aspx", "EPiCloner.Templates.Plugins.Cloning.CloningPlugin.aspx", false));
            HostingEnvironment.RegisterVirtualPathProvider(new ResourcePathProvider("/EPiSiteVerification.aspx", "EPiCloner.Templates.Plugins.Cloning.SiteStructureVerificationPlugin.aspx", false));
        }                                                                                                             

        public void Uninitialize(InitializationEngine context)
        {
        }

        public void Preload(string[] parameters)
        {
        }
    }
}